<?php # Script 3.7 - dateform.php

$page_title = 'Calendar Form';
include('includes/header.html');
?>
	<div id="wrap">
		<div class="navbar navbar-inverse">
			<div class="navbar-inner">
				<div class="container">
					<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</a>
					<a class="brand" href="#">Your Website</a>
					<div class="nav-collapse collapse">
						<ul class="nav">
							<li class=""><a href="index.php">홈</a></li>
							<li class=""><a href="calculator05.php">계산기</a></li>
							<li class="active"><a href="dateform.php">날짜 폼</a></li>
							<li class=""><a href="#">link four</a></li>
							<li class=""><a href="#">link five</a></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<div class="container">
			<div class="page-header">
    	<!-- Start of the page-specific content. -->

<?php

// This function makes three pull-down menus
// for selecting a month, day, and year.
function make_calendar_pulldown(){

	// Make the months array:
	$months = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );

	// Make the months pull-down menu:
	echo '<select name="month">';
	foreach ($months as $key => $value) {
		echo "<option value=\"$key\">$value</option>\n";
	}
	echo '</select>';

	// Make the days pull-down menu:
	echo '<select name="day">';
	for ($day=1; $day < 31; $day++) { 
		echo "<option value=\"$day\">$day</option>\n";
	}
	echo '</select>';

	// Make the years pull-down menu:
	echo '<select name="year">';
	for ($year=2008; $year < 2018; $year++) { 
		echo "<option value=\"$year\">$year</option>\n";
	}
	echo '</select>';

} // End of the function definition.

// Create the form tags:
echo '<h1>Select a Date:</h1><form action="dateform.php" method="post">';

// Call the function.
make_calendar_pulldown();

echo '</form>';

include('includes/footer.html');
?>